.class public final Lcom/netease/newsreader/util/Strings;
.super Ljava/lang/Object;
.source "Strings.java"


# static fields
.field private static final DIGITS:[C

.field private static final UPPER_CASE_DIGITS:[C


# direct methods
.method static constructor <clinit>()V
    .locals 2

    .prologue
    const/16 v1, 0x24

    .line 11
    new-array v0, v1, [C

    fill-array-data v0, :array_0

    sput-object v0, Lcom/netease/newsreader/util/Strings;->DIGITS:[C

    .line 18
    new-array v0, v1, [C

    fill-array-data v0, :array_1

    sput-object v0, Lcom/netease/newsreader/util/Strings;->UPPER_CASE_DIGITS:[C

    .line 6
    return-void

    .line 11
    nop

    :array_0
    .array-data 0x2
        0x30t 0x0t
        0x31t 0x0t
        0x32t 0x0t
        0x33t 0x0t
        0x34t 0x0t
        0x35t 0x0t
        0x36t 0x0t
        0x37t 0x0t
        0x38t 0x0t
        0x39t 0x0t
        0x61t 0x0t
        0x62t 0x0t
        0x63t 0x0t
        0x64t 0x0t
        0x65t 0x0t
        0x66t 0x0t
        0x67t 0x0t
        0x68t 0x0t
        0x69t 0x0t
        0x6at 0x0t
        0x6bt 0x0t
        0x6ct 0x0t
        0x6dt 0x0t
        0x6et 0x0t
        0x6ft 0x0t
        0x70t 0x0t
        0x71t 0x0t
        0x72t 0x0t
        0x73t 0x0t
        0x74t 0x0t
        0x75t 0x0t
        0x76t 0x0t
        0x77t 0x0t
        0x78t 0x0t
        0x79t 0x0t
        0x7at 0x0t
    .end array-data

    .line 18
    :array_1
    .array-data 0x2
        0x30t 0x0t
        0x31t 0x0t
        0x32t 0x0t
        0x33t 0x0t
        0x34t 0x0t
        0x35t 0x0t
        0x36t 0x0t
        0x37t 0x0t
        0x38t 0x0t
        0x39t 0x0t
        0x41t 0x0t
        0x42t 0x0t
        0x43t 0x0t
        0x44t 0x0t
        0x45t 0x0t
        0x46t 0x0t
        0x47t 0x0t
        0x48t 0x0t
        0x49t 0x0t
        0x4at 0x0t
        0x4bt 0x0t
        0x4ct 0x0t
        0x4dt 0x0t
        0x4et 0x0t
        0x4ft 0x0t
        0x50t 0x0t
        0x51t 0x0t
        0x52t 0x0t
        0x53t 0x0t
        0x54t 0x0t
        0x55t 0x0t
        0x56t 0x0t
        0x57t 0x0t
        0x58t 0x0t
        0x59t 0x0t
        0x5at 0x0t
    .end array-data
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 6
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static bytesToHexString([BZ)Ljava/lang/String;
    .locals 8
    .parameter "bytes"
    .parameter "upperCase"

    .prologue
    .line 66
    if-eqz p1, :cond_0

    sget-object v4, Lcom/netease/newsreader/util/Strings;->UPPER_CASE_DIGITS:[C

    .line 67
    .local v4, digits:[C
    :goto_0
    array-length v5, p0

    mul-int/lit8 v5, v5, 0x2

    new-array v1, v5, [C

    .line 68
    .local v1, buf:[C
    const/4 v2, 0x0

    .line 69
    .local v2, c:I
    array-length v6, p0

    const/4 v5, 0x0

    move v3, v2

    .end local v2           #c:I
    .local v3, c:I
    :goto_1
    if-lt v5, v6, :cond_1

    .line 73
    new-instance v5, Ljava/lang/String;

    invoke-direct {v5, v1}, Ljava/lang/String;-><init>([C)V

    return-object v5

    .line 66
    .end local v1           #buf:[C
    .end local v3           #c:I
    .end local v4           #digits:[C
    :cond_0
    sget-object v4, Lcom/netease/newsreader/util/Strings;->DIGITS:[C

    goto :goto_0

    .line 69
    .restart local v1       #buf:[C
    .restart local v3       #c:I
    .restart local v4       #digits:[C
    :cond_1
    aget-byte v0, p0, v5

    .line 70
    .local v0, b:B
    add-int/lit8 v2, v3, 0x1

    .end local v3           #c:I
    .restart local v2       #c:I
    shr-int/lit8 v7, v0, 0x4

    and-int/lit8 v7, v7, 0xf

    aget-char v7, v4, v7

    aput-char v7, v1, v3

    .line 71
    add-int/lit8 v3, v2, 0x1

    .end local v2           #c:I
    .restart local v3       #c:I
    and-int/lit8 v7, v0, 0xf

    aget-char v7, v4, v7

    aput-char v7, v1, v2

    .line 69
    add-int/lit8 v5, v5, 0x1

    goto :goto_1
.end method

.method public static final construct([BIILjava/nio/charset/Charset;)Ljava/lang/String;
    .locals 3
    .parameter "data"
    .parameter "offset"
    .parameter "byteCount"
    .parameter "charset"

    .prologue
    .line 43
    :try_start_0
    new-instance v1, Ljava/lang/String;

    invoke-virtual {p3}, Ljava/nio/charset/Charset;->name()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, p0, p1, p2, v2}, Ljava/lang/String;-><init>([BIILjava/lang/String;)V
    :try_end_0
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_0 .. :try_end_0} :catch_0

    return-object v1

    .line 44
    :catch_0
    move-exception v0

    .line 45
    .local v0, e:Ljava/io/UnsupportedEncodingException;
    new-instance v1, Ljava/lang/IllegalArgumentException;

    invoke-direct {v1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/Throwable;)V

    throw v1
.end method

.method public static getBytes(Ljava/lang/String;Ljava/nio/charset/Charset;)[B
    .locals 2
    .parameter "string"
    .parameter "charset"

    .prologue
    .line 59
    :try_start_0
    invoke-virtual {p1}, Ljava/nio/charset/Charset;->name()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p0, v1}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B
    :try_end_0
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    return-object v1

    .line 60
    :catch_0
    move-exception v0

    .line 61
    .local v0, e:Ljava/io/UnsupportedEncodingException;
    new-instance v1, Ljava/lang/IllegalArgumentException;

    invoke-direct {v1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/Throwable;)V

    throw v1
.end method

.method public static final isEmpty(Ljava/lang/String;)Z
    .locals 1
    .parameter "string"

    .prologue
    .line 26
    if-eqz p0, :cond_0

    invoke-virtual {p0}, Ljava/lang/String;->length()I

    move-result v0

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x1

    goto :goto_0
.end method
